The parameter presently used to control the magnesium doping profile during semiconductor device processing (e.g., light emitting diode (LED) processing) is growth temperature. The magnesium doping profile depends on the growth temperature of the layers of the semiconductor device because the diffusion of the magnesium is temperature dependent.